/**
 *  用于token存取的一些函数
 * */


const tokenKey = 'customerTokenKey';
const tokenHeadKey = 'customerTokenHeadKey';
const tokenHeaderNameKey = 'customerTokenHeaderNameKey';
const userKey = 'customerKey';

export function getToken() {
  return window.localStorage.getItem(tokenKey)
}

export function setToken(token) {
  return window.localStorage.setItem(tokenKey, token)
}

export function removeToken() {
  return window.localStorage.removeItem(tokenKey)
}

export function getTokenHead() {
  return window.localStorage.getItem(tokenHeadKey);
}

export function setTokenHead(tokenHead) {
  window.localStorage.setItem(tokenHeadKey,tokenHead);
}

export function removeTokenHead() {
  return window.localStorage.removeItem(tokenHeadKey);
}

export function getTokenHeaderName() {
  return window.localStorage.getItem(tokenHeaderNameKey);
}

export function setTokenHeaderName(tokenHeaderName) {
  return window.localStorage.setItem(tokenHeaderNameKey,tokenHeaderName);
}

export function removeTokenHeaderName() {
  return window.localStorage.removeItem(tokenHeaderNameKey);
}

export function setUser(user) {
  window.localStorage.setItem(userKey,JSON.stringify(user));
}

export function getUser() {
  return JSON.parse(window.localStorage.getItem(userKey))
}

export function removeUser() {
  window.localStorage.removeItem(userKey);
}

